/************************************************************************************
 Note: all the Button... files refers to this source for the container comments.

 RC Hobby Stream
 Twitter automatic feeder

 First version developed with support of Mapelgate Media

"RC Hobby Stream" is protected by the copyright law
© 2011 Enrico Miglino / Tech Consulting (enrico.miglino@ovi.com)
Distributed under the LGPL 3.0 license.

This file is part of "RC Hobby Stream".

    "RC Hobby Stream" is free software: you can redistribute it
    and/or modify it under the terms of the Lesser GNU General Public License
    as published by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    "RC Hobby Stream" is distributed in the hope that it
    will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    Lesser GNU General Public License for more details.

    You should have received a copy of the Lesser GNU General Public License
    along with "RC Hobby Stream".
    If not, see <http://www.gnu.org/licenses/>.
************************************************************************************/

import Qt 4.7

Item {
    id: container   // Button 1 container

    // Managed signal for button handler
    signal clicked
    property bool keyUsing: false

    // Definition of the couple of images for button and button-pressed
    BorderImage {
        id: buttonImage
        source: "../images/B.png"
        width: container.width; height: container.height
    }
    BorderImage {
        id: pressed
        opacity: 0
        source: "../images/B_light.png"
        width: container.width; height: container.height
    }
    // Definition of the clickable area for the button
    MouseArea {
        id: mouseRegion
        anchors.fill: buttonImage
        onClicked: { container.clicked(); }
    }
    // States managed for the button
    states: [
        State {
            name: "Pressed"
            when: mouseRegion.pressed == true
            PropertyChanges { target: pressed; opacity: 1 }
        },
        // Focused state is not managed actually. For future use only.
        State {
            name: "Focused"
            when: container.activeFocus == true
        }
    ]
}
